package BasicCmIRPSystem;


/**
 * Generated from IDL interface "DeleteResultIterator".
 *
 * @author JacORB IDL compiler V 2.3.0, 17-Feb-2007
 * @version generated at 2013-5-20 22:07:19
 */

public class _DeleteResultIteratorStub
	extends org.omg.CORBA.portable.ObjectImpl
	implements BasicCmIRPSystem.DeleteResultIterator
{
	private String[] ids = {"IDL:BasicCmIRPSystem/DeleteResultIterator:1.0","IDL:BasicCmIRPSystem/BasicCmInformationIterator:1.0"};
	public String[] _ids()
	{
		return ids;
	}

	public final static java.lang.Class _opsClass = BasicCmIRPSystem.DeleteResultIteratorOperations.class;
	public boolean next_basic_cm_informations(short how_many, BasicCmIRPConstDefs.ResultSetHolder fetched_elements) throws BasicCmIRPSystem.NextBasicCmInformations,ManagedGenericIRPSystem.InvalidParameter,ManagedGenericIRPSystem.OperationNotSupported
	{
		while(true)
		{
		if(! this._is_local())
		{
			org.omg.CORBA.portable.InputStream _is = null;
			try
			{
				org.omg.CORBA.portable.OutputStream _os = _request( "next_basic_cm_informations", true);
				_os.write_ushort(how_many);
				_is = _invoke(_os);
				boolean _result = _is.read_boolean();
				fetched_elements.value = BasicCmIRPConstDefs.ResultSetHelper.read(_is);
				return _result;
			}
			catch( org.omg.CORBA.portable.RemarshalException _rx ){}
			catch( org.omg.CORBA.portable.ApplicationException _ax )
			{
				String _id = _ax.getId();
				if( _id.equals("IDL:BasicCmIRPSystem/NextBasicCmInformations:1.0"))
				{
					throw BasicCmIRPSystem.NextBasicCmInformationsHelper.read(_ax.getInputStream());
				}
				else if( _id.equals("IDL:ManagedGenericIRPSystem/InvalidParameter:1.0"))
				{
					throw ManagedGenericIRPSystem.InvalidParameterHelper.read(_ax.getInputStream());
				}
				else if( _id.equals("IDL:ManagedGenericIRPSystem/OperationNotSupported:1.0"))
				{
					throw ManagedGenericIRPSystem.OperationNotSupportedHelper.read(_ax.getInputStream());
				}
				throw new RuntimeException("Unexpected exception " + _id );
			}
			finally
			{
				this._releaseReply(_is);
			}
		}
		else
		{
			org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke( "next_basic_cm_informations", _opsClass );
			if( _so == null )
				throw new org.omg.CORBA.UNKNOWN("local invocations not supported!");
			DeleteResultIteratorOperations _localServant = (DeleteResultIteratorOperations)_so.servant;
			boolean _result;
			try
			{
				_result = _localServant.next_basic_cm_informations(how_many,fetched_elements);
			}
			finally
			{
				_servant_postinvoke(_so);
			}
			return _result;
		}

		}

	}

	public boolean next_delete_errors(short how_many, BasicCmIRPConstDefs.DeleteErrorSeqHolder fetched_delete_errors) throws ManagedGenericIRPSystem.InvalidParameter,BasicCmIRPSystem.NextDeleteErrors
	{
		while(true)
		{
		if(! this._is_local())
		{
			org.omg.CORBA.portable.InputStream _is = null;
			try
			{
				org.omg.CORBA.portable.OutputStream _os = _request( "next_delete_errors", true);
				_os.write_ushort(how_many);
				_is = _invoke(_os);
				boolean _result = _is.read_boolean();
				fetched_delete_errors.value = BasicCmIRPConstDefs.DeleteErrorSeqHelper.read(_is);
				return _result;
			}
			catch( org.omg.CORBA.portable.RemarshalException _rx ){}
			catch( org.omg.CORBA.portable.ApplicationException _ax )
			{
				String _id = _ax.getId();
				if( _id.equals("IDL:ManagedGenericIRPSystem/InvalidParameter:1.0"))
				{
					throw ManagedGenericIRPSystem.InvalidParameterHelper.read(_ax.getInputStream());
				}
				else if( _id.equals("IDL:BasicCmIRPSystem/NextDeleteErrors:1.0"))
				{
					throw BasicCmIRPSystem.NextDeleteErrorsHelper.read(_ax.getInputStream());
				}
				throw new RuntimeException("Unexpected exception " + _id );
			}
			finally
			{
				this._releaseReply(_is);
			}
		}
		else
		{
			org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke( "next_delete_errors", _opsClass );
			if( _so == null )
				throw new org.omg.CORBA.UNKNOWN("local invocations not supported!");
			DeleteResultIteratorOperations _localServant = (DeleteResultIteratorOperations)_so.servant;
			boolean _result;
			try
			{
				_result = _localServant.next_delete_errors(how_many,fetched_delete_errors);
			}
			finally
			{
				_servant_postinvoke(_so);
			}
			return _result;
		}

		}

	}

	public void destroy() throws BasicCmIRPSystem.DestroyException,ManagedGenericIRPSystem.OperationNotSupported
	{
		while(true)
		{
		if(! this._is_local())
		{
			org.omg.CORBA.portable.InputStream _is = null;
			try
			{
				org.omg.CORBA.portable.OutputStream _os = _request( "destroy", true);
				_is = _invoke(_os);
				return;
			}
			catch( org.omg.CORBA.portable.RemarshalException _rx ){}
			catch( org.omg.CORBA.portable.ApplicationException _ax )
			{
				String _id = _ax.getId();
				if( _id.equals("IDL:BasicCmIRPSystem/DestroyException:1.0"))
				{
					throw BasicCmIRPSystem.DestroyExceptionHelper.read(_ax.getInputStream());
				}
				else if( _id.equals("IDL:ManagedGenericIRPSystem/OperationNotSupported:1.0"))
				{
					throw ManagedGenericIRPSystem.OperationNotSupportedHelper.read(_ax.getInputStream());
				}
				throw new RuntimeException("Unexpected exception " + _id );
			}
			finally
			{
				this._releaseReply(_is);
			}
		}
		else
		{
			org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke( "destroy", _opsClass );
			if( _so == null )
				throw new org.omg.CORBA.UNKNOWN("local invocations not supported!");
			DeleteResultIteratorOperations _localServant = (DeleteResultIteratorOperations)_so.servant;
			try
			{
				_localServant.destroy();
			}
			finally
			{
				_servant_postinvoke(_so);
			}
			return;
		}

		}

	}

}
